/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

/**
 * 共配数据统计
 *  */
import React, { useState, useCallback } from "react";
import StandardTab from "@/components/StandardTab";
import PageHeaderLayout from "@/layouts/PageHeaderLayout";
import { connect } from "dva";
import DataStatisticsTemplate from "./components/DataStatisticsTemplate";
import styles from "./style.less";

const DataStatistics = () => {
  const [activeKey, setActiveKey] = useState("scan");

  const onChange = useCallback(_activeKey => {
    setActiveKey(_activeKey);
  }, []);

  return (
    <PageHeaderLayout title="数据统计">
      <div className={styles.main}>
        <div style={{ paddingBottom: "24px" }}>
          <StandardTab
            style={{ marginBottom: 24 }}
            onChange={onChange}
            activeKey={activeKey}
            name="dataStatistics"
            panes={[
              {
                tab: "扫描统计",
                key: "scan",
                component: <DataStatisticsTemplate type="scan" />,
              },
              {
                tab: "派件统计",
                key: "send",
                component: <DataStatisticsTemplate type="send" />,
              },
            ]}
          />
        </div>
      </div>
    </PageHeaderLayout>
  );
};

export default connect()(React.memo(DataStatistics));
